﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using ADO;

namespace Service.Login
{
    class InfoManager:LogIn
    {
        //---------------
       override public bool   EnterInterface()
        {
            return true;
        }
        //----------
       override public void   Initialize( String t_name,String t_password )
        {
            name      = t_name;
            password  = t_password;
        }
        //--------------------------
       override public bool IsLegal()
        {
            String sqlstr = "";
            DataSet DataTable;
           if(name == ""|| password == "")
               return false;
           sqlstr = "select password from Staff where StaffID="+name;
           DataBaseAccess DAO = new DataBaseAccess();
           DataTable = DAO.GetDataSet(sqlstr);
            if( DataTable.Tables[0].Rows[0][0].ToString() != password )
                return false;
            return true;
        }
        //---------------------------------------
       override public bool   Record()
        {
            return true;
        }
        //-----------------------------------------
        private String   name;
        private String   password;
    }
}
